import axios from '@/request/request'
import qs from  'qs'
export const first = () => axios.get('/products/recommend')
export const second = () => axios.get('/products/hot')
export const third = (phone) =>axios.post('/sendSMS',qs.stringify(phone))
export const fourth = (phone) =>axios.post('/phoneRegin',qs.stringify(phone))
/* 微信登录  */
export const WeixinLoginApi = (params) => axios.post(`/wechatUsers/PCLogin`, qs.stringify(params));
export const BinddingAPI = (params) => axios.post("/wechatUsers/binding", qs.stringify(params));

export const UserApi = () => axios.get('/shop/userProfiles')
export const GoodsDetailsAPI = (id) => axios.get(`/products/${id}`)
console.log('序列化',qs.stringify({a:10,b:20}))
//GoodsSearchAPI
export const GoodsSearchAPI = (params) => axios.get('/products',{params})
//添加到购物车

export const addShop = (params) => axios.post("/shop/carts/add", qs.stringify(params));
//查看购物车

export const CartDataApi = () => axios.get('/shop/carts')
//删除购物车
// /shop/carts?productIds={id}
export const delFn = (id) => axios.delete(`/shop/carts?productIds=${id}`)
//解绑 微信   /wechatUsers/unbindingWeChat
export const Unbind = () => axios.put('wechatUsers/unbindingWeChat')